<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

$bar="List Staff Foreigners";
        echo '<table id="box-table-a" cellspacing="1" align="right" width="900px">';
        echo '<tr><td colspan=5 align=right class=bar>'.$bar.'</td></tr>';
        echo '<tr><td colspan=5 align=right class=pagination>'.$pagination.'</td></tr>';
        echo '
              <th>Staff_ID</th>
              <th>FullName</th>
              <th>FirstName</th>
              <th>LastName</th>
              <th>Action</th>';
        foreach($query as $row){
            //$images='<img src="'.base_url().'application/templates/images/'.$row->staff_avarta.'" width=100 height=70>';
            //$details = anchor("user/loadUpdateForm/$row->Staff_ID",$images);
            $sql="select * from PassVi where Passport_ID=$row->ID_Number";
            $query1=$this->db->query($sql);
            echo "<tr>
                        <td class=\"row10\">$row->Staff_ID</td>
                        <td class=\"row12\">$row->FullName</td>
                        <td class=\"row10\">$row->FirstName</td>
                        <td class=\"row12\">$row->LastName</td>";
            if($query1->num_rows()==0)
            {
                $titleAdd = '<img src ="'.base_url().'templates/images/icons/add.jpeg" width=40 height=25 title="Click here to add passport and visa"/>';
                $add = anchor("staff/loadFormAddPassVi/$row->ID_Number",$titleAdd);
                echo "<td class=\"row12\" align=\"center\">$add</td></tr>";
            }
            else
            {
                $titleEdit = '<img src ="'.base_url().'templates/images/icons/edit.gif" title="Click here to update passport and visa"/>';
                $edit = anchor("staff/loadFormUpdatePassVi/$row->ID_Number",$titleEdit);
                echo "<td class=\"row12\" align=\"center\">$edit</td></tr>";
            }
            
            }
            //$titleInsert = '<img src ="'.base_url().'templates/images/icons/addstaff.jpeg" width=60 height=40 title="Click here to insert staff"/>';
            //$insert = anchor("staff/loadInterviewerPass",$titleInsert);
            echo '<tr><td colspan=5 align=right class=pagination>'.$pagination.'</td></tr>';
            $titleback = '<img src ="'.base_url().'templates/images/icons/back.jpg" width=40 height=25 title="Back"/>';
            $back = anchor("staff/index",$titleback);
            echo '<tr><td colspan=5 align=center>'. $back.'</td></tr>';
        echo '</table>';
?>
